//
//  HJBottomView.swift
//  HJWeiBo
//
//  Created by 黄珏 on 15/11/1.
//  Copyright © 2015年 黄珏. All rights reserved.
//

import UIKit

class HJBottomView: UIView {
    //MARK:构造函数
    override init(frame: CGRect) {
        super.init(frame: frame)
        prepareUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func prepareUI() {
//        添加子空间
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(likeButton)
        addSubview(separatorViewOne)
        addSubview(separatorViewTwo)
        
        self.ff_HorizontalTile([forwardButton, commentButton, likeButton], insets: UIEdgeInsetsZero)
        
        // 分割线1
        separatorViewOne.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: forwardButton, size: nil)
        
        // 分割线2
        separatorViewTwo.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: commentButton, size: nil)
    }
//    MARK:懒加载
    private lazy var forwardButton: UIButton = UIButton(title: "转发", fontSize: 12, textColor: UIColor.darkGrayColor(), imageName: "timeline_icon_retweet")
    private lazy var commentButton:UIButton = UIButton(title: "评论", fontSize: 12, textColor: UIColor.darkGrayColor(), imageName: "timeline_icon_comment")
    private lazy var likeButton:UIButton = UIButton(title: "赞", fontSize: 12, textColor: UIColor.darkGrayColor(), imageName: "timeline_icon_unlike")
//    分割线
    private lazy var separatorViewOne: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
    private lazy var separatorViewTwo: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line_highlighted"))
}
